package org.bleep.scene;

import org.bleep.geom.Rectangle;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.Sys;

public class Camera extends Node
{
	protected Rectangle bounds;
	protected float zoom;
	
	public Camera()
	{
		super();
		zoom = 1.0f;
	}
	
	public void pan(float x, float y)
	{
		bounds.translate(x, y);
	}
	
	public void setZoom(float factor)
	{
		zoom = factor;
	}
	
	public void setCenter(float x, float y)
	{
		bounds.setCenter(x, y);
	}
	
	public void pre()
	{
		DisplayMode d = Display.getDisplayMode();
		int width = d.getWidth();
		int height = d.getHeight();
		
		GL11.glPushMatrix();
		GL11.glTranslatef(bounds.getX(), bounds.getY(), 0.0f);
	}
	
	public void post()
	{
		GL11.glPopMatrix();
	}
}